package com.example.tests;

import org.testng.annotations.Test;

public class UA_StoreManagement extends TestBase{
	
	 //@Test
	  public void testCreationNewStore() throws Exception {	
	
	    // Login as Udozi Admin
		openMainPage();
	    openLoginForm();
	    LoginData loginCredentials = new LoginData();
	    loginCredentials.email = "admin2@udozi.com";
		loginCredentials.password = "2710FA8D";
		fillLoginForm(loginCredentials);
		submitLoginInfo();
		verificationSuccessLogin();  
		
		//creation New Store 
		navigateToStoreManagement();
		
		StoreData storeData = new StoreData();
		storeData.storeName= "Ameli Test";
		storeData.nameSA = "Tanya";
		storeData.lastnameSA= "Test";
		storeData.phoneSA= "02015900100";
		storeData.emailSA= "ameli_test_store@mail.ru";
		storeData.passwordSA= "1111";
		
		verificationStoreNotExist(storeData);
		openNewStoreForm(); 
		fillStoreForm(storeData);	
		
		submitStoreInfo(); 
		verificationNewStore(storeData);
		
		logOutFromSite();
		
	}
	 
	 @Test
	 public void testCreationNewBranch() throws InterruptedException {
		 //Login as Udozi Admin
		 openMainPage();
		 openLoginForm();
		 LoginData loginCredentials = new LoginData();
		 loginCredentials.email = "admin2@udozi.com";
		 loginCredentials.password = "2710FA8D";
		 fillLoginForm(loginCredentials);
		 submitLoginInfo();
		 verificationSuccessLogin();  
		 
		 //creation New Store 
		 navigateToStoreManagement();
		 BranchData branchData = new BranchData(); 
		 branchData.branchName = "Ameli Branch";
		 branchData.street = "Kendal Street";
		 branchData.city = "London";
		 branchData.postCode = "W2 2AW";
		 branchData.phone = "02015955080"; 
		 
		 verificationBranchNotExist("Ameli Test"); 
		 openNewBranchForm();
		 fillBranchForm(branchData);
		 submitBranchInfo(); 
		 verificationNewBranch("Ameli Test", branchData);
	 }
	
}
